<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="author" content="zhupeng">
	<TITLE>采购空白IC卡入库</TITLE>
	 
	<script language="javascript" src="../script/common.js"  type="text/javascript"></script>
	<script language="javascript" type="text/javascript">
		var billId;
		var billType;
		//页面加载方法
		function load(){
			Eui.showNavigation();
			Eui.initDateInput("beginDateTd","出厂日期","whiteEnterForm","leftFactoryDate","_pastDate",true);
			setPages(["selectdetview","detview","printview"]);		
		}
	
		//取消方法
		 function resetFunc(){
			$("whiteEnterForm").reset();
			switchPage('detview');
		}
		//选择卡片规格
		function selSpec(){			
			var v = openDialogFrame("/store/sel_white_list.html?",'请选择卡片规格',464,700)
			if (v){
			var form=$("whiteEnterForm")
			    form.cardSpec.value = v.id;
				form.cardSpecs.value = v.name;
			}
		}
   		 //保存入库单方法
   	 	function onSave(){
			if(!checkForm(whiteEnterForm))return;
			if(showQuestion("您确认保存?")==true){
				var values = Common.getValues(whiteEnterForm);
		      	DWR.call('blankCardStoreService.addBlankCard',values,function(v){
					if(v){
						showInformation("入库成功!");
						billId = v.id
						billType = CardBillType.IN;
						requestframe.document.location.href = "print_blank_bill.html";
						switchPage("printview"); 
						//CardStore.showBlankBill('selectdetview',v.id);	
					}
			  		
			   	},{disCtrl:$('saveBut')});
		   	}
		}  
		//打印方法
		function printlnBlankBill(){
			billType = CardBillType.IN;
			requestframe.document.location.href = "print_blank_bill.html";
			switchPage("printview");
			//var v = openDialogFrame("/store/print_blank_bill.html?billType="+CardBillType.IN+"&billId="+billId,"打印单据",450,700);
		}
		//返回方法
		function closePrintDialog(){
			whiteEnterForm.reset();
			switchPage("detview");
		}
	</script>
</head>
<body onload="load()" >
	<!--页面导航-->
	<div class="nav"><div id="nav">&nbsp;</div></div>
	
	<!--明细(新增)静态页面部分-->
	<div id="detview" style="">
		<form id="whiteEnterForm" name="whiteEnterForm">
			<input type="hidden" name="cardSpec">
			<div class="form">
			<div class="formTitle">白卡入库</div>
				<table cellSpacing=0 cellPadding=4 width="100%" border=0>
					<tr>
						<td><label>卡片规格</label> <input type="text"  name="cardSpecs" readonly class="readonly" onblur="checkV(this,'',true)" ><a class=orga title="选择卡片规格" href="javascript:void(0)" onclick="selSpec()">&nbsp;&nbsp;</a><span class="des">*</span></td>
						<td><label>数&nbsp;&nbsp;&nbsp;&nbsp;量</label> <input type="text" name="amount"  maxlength="9" onblur="checkV(this,'positiveInt',true)" ><span class="des">*</span></td>   
					</tr>	
					<tr>
					   <td id="beginDateTd">&nbsp;</td> 
					   <td><label>备&nbsp;&nbsp;&nbsp;&nbsp;注</label> <input type="text" name="description"   maxlength="32" ></td> 
					</tr>
				</table>
			</div>
			<p><button type="button" id="saveBut" onclick="onSave()">保 存</button></p>
		</form>
	</div>
	<div id="selectdetview" style="display:none;" align="center"></div>
	
	<div class="printview" id="printview" style='display:none;'>
		<iframe id="requestframe" name="requestframe" style="width:100%;height:90%;overflow:auto;" frameborder=0 src=""></iframe>
	</div>
</body>
</html>
